package com.twu.biblioteca;

import java.io.Reader;
import java.io.PrintStream;
import java.io.InputStreamReader;

import com.twu.biblioteca.content.BookContent;
import com.twu.biblioteca.content.MovieContent;

public class BibliotecaApp {

    private final PrintStream out;

    private String welcomeMessage;
    private BookContent bookContent;
    private MovieContent movieContent;
    private BibliotecaMenu menu;

    public BibliotecaApp(PrintStream out, Reader reader) {
        welcomeMessage = "Welcome to Biblioteca!";
        bookContent = new BookContent();
        movieContent = new MovieContent();
        menu = new BibliotecaMenu(bookContent, movieContent, reader);
        this.out = out;
    }

    public static void main(String[] args) {
        new BibliotecaApp(System.out, new InputStreamReader(System.in)).run();
    }

    protected void run(){
        out.println(this.welcomeMessage + '\n');
        this.menu.displayMenu();
    }

}
